package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysProvidecontractMapper;
import com.ruoyi.system.domain.SysProvidecontract;
import com.ruoyi.system.service.ISysProvidecontractService;
import com.ruoyi.common.core.text.Convert;

/**
 * 供货合同实体Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-12-13
 */
@Service
public class SysProvidecontractServiceImpl implements ISysProvidecontractService 
{
    @Autowired
    private SysProvidecontractMapper sysProvidecontractMapper;

    /**
     * 查询供货合同实体
     * 
     * @param provideContractId 供货合同实体ID
     * @return 供货合同实体
     */
    @Override
    public SysProvidecontract selectSysProvidecontractById(Long provideContractId)
    {
        return sysProvidecontractMapper.selectSysProvidecontractById(provideContractId);
    }

    /**
     * 查询供货合同实体列表
     * 
     * @param sysProvidecontract 供货合同实体
     * @return 供货合同实体
     */
    @Override
    public List<SysProvidecontract> selectSysProvidecontractList(SysProvidecontract sysProvidecontract)
    {
        return sysProvidecontractMapper.selectSysProvidecontractList(sysProvidecontract);
    }
    public List<SysProvidecontract> findContractNumber(String year){
        return sysProvidecontractMapper.findContractNumber(year);
    }
    /**
     * 新增供货合同实体
     * 
     * @param sysProvidecontract 供货合同实体
     * @return 结果
     */
    @Override
    public int insertSysProvidecontract(SysProvidecontract sysProvidecontract)
    {
        sysProvidecontract.setCreateTime(DateUtils.getNowDate());
        return sysProvidecontractMapper.insertSysProvidecontract(sysProvidecontract);
    }

    /**
     * 修改供货合同实体
     * 
     * @param sysProvidecontract 供货合同实体
     * @return 结果
     */
    @Override
    public int updateSysProvidecontract(SysProvidecontract sysProvidecontract)
    {
        return sysProvidecontractMapper.updateSysProvidecontract(sysProvidecontract);
    }

    /**
     * 删除供货合同实体对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysProvidecontractByIds(String ids)
    {
        return sysProvidecontractMapper.deleteSysProvidecontractByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除供货合同实体信息
     * 
     * @param provideContractId 供货合同实体ID
     * @return 结果
     */
    @Override
    public int deleteSysProvidecontractById(Long provideContractId)
    {
        return sysProvidecontractMapper.deleteSysProvidecontractById(provideContractId);
    }
}
